package com.ce.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo.State;
import android.os.Environment;

public class CheckUtils {
	
	public static boolean checkNetWorkInfo(Context context) {
		ConnectivityManager mManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
		State mobile = mManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState();
		State wifi = mManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState();
		if(mobile == State.CONNECTED || mobile == State.CONNECTING)
			return true;
		if(wifi == State.CONNECTED || wifi == State.CONNECTING) 
			return true;
		return false;		
	}
	
	public static boolean checkSDCard() {
		if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) 
			return true;
		return false;
	}
}
